package org.appfuse.tutorial.webapp.action;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.appfuse.service.GenericManager;
import org.appfuse.tutorial.model.Person;
import org.appfuse.webapp.action.BaseAction;

public class PersonAction extends BaseAction {
	
	private static Log logger = LogFactory.getLog(org.appfuse.tutorial.webapp.action.PersonAction.class);
	
	private GenericManager<Person, Long> personManager; 
	private List persons;
	public List getPersons() {
		return persons;
	}
	
	public void setPersonManager(GenericManager<Person, Long> personManager) {
		this.personManager = personManager;
	}
	
	public String list() { 
		logger.debug("into PersonAction.list(...)");
//		logger.info("into PersonAction.list(...)");
//		logger.warn("into PersonAction.list(...)");
//		logger.error("into PersonAction.list(...)");
		persons = personManager.getAll();
		return SUCCESS; 
	}

}
